#pragma once

#include "path.h"

namespace sfc::fs {

struct OpenOptions {
  bool read = false;
  bool write = false;
  bool truncate = false;
  bool append = false;
  bool create = false;
  bool create_new = false;

  auto create_mode() const -> u32;
  auto access_mode() const -> u32;
  auto open(Path path) const -> struct File;
};

struct File : io::File, io::Read<File>, io::Write<File> {
  using Base = io::File;

  static auto create(Path p) -> File;
  static auto open(Path p) -> File;

  void flush();
};

}  // namespace sfc::fs
